<?php

/**
 * @file
 * Default simple view template to all the fields as a row.
 *
 * - $view: The view in use.
 * - $fields: an array of $field objects. Each one contains:
 *   - $field->content: The output of the field.
 *   - $field->raw: The raw data for the field, if it exists. This is NOT output safe.
 *   - $field->class: The safe class id to use.
 *   - $field->handler: The Views field handler object controlling this field. Do not use
 *     var_export to dump this object, as it can't handle the recursion.
 *   - $field->inline: Whether or not the field should be inline.
 *   - $field->inline_html: either div or span based on the above flag.
 *   - $field->wrapper_prefix: A complete wrapper containing the inline_html to use.
 *   - $field->wrapper_suffix: The closing tag for the wrapper.
 *   - $field->separator: an optional separator that may appear before a field.
 *   - $field->label: The wrap label text to use.
 *   - $field->label_html: The full HTML of the label to use including
 *     configured element type.
 * - $row: The raw result object from the query, with all data it fetched.
 *
 * @ingroup views_templates
 */
?>
    <div class="col-sm-3">
            <div class="one-staff">
                <?php if(isset($fields['field_team_image'])):?>
                    <?php print $fields['field_team_image']->content;?>
                <?php endif;?>
                <div class="content ">
                    <?php if(isset($fields['title'])):?>
                        <?php print $fields['title']->content;?>
                    <?php endif;?>
                    <div class="position_title">
                        <?php if(isset($fields['field_team_job'])):?>
                            <?php print $fields['field_team_job']->content;?>
                        <?php endif;?>
                    </div>
                    <?php if(isset($fields['body'])):?>
                        <?php print $fields['body']->content;?>
                    <?php endif;?>
                </div>
                <div class="social_widget"><span class="connect">Connect here:</span>
                    <ul>
                        <?php foreach($row->field_field_team_socials as $value):
                            $raw_value = $value['raw']['value'];
                            $link = $value['rendered']['entity']['field_collection_item'][$raw_value]['field_team_socials_link'][0]['#markup'];
                            $fa = $value['rendered']['entity']['field_collection_item'][$raw_value]['field_team_socials_icon'][0]['#bundle'];
                            $fa_name = $value['rendered']['entity']['field_collection_item'][$raw_value]['field_team_socials_icon'][0]['#icon'];
                            ?>
                            <li><a href="<?php print $link;?>"><i class="<?php print $fa;?> <?php print $fa_name;?>"></i></a>
                            </li>
                        <?php endforeach;?>
                    </ul>
                </div>
            </div>
    </div>
<?php unset($fields['title']);?>
<?php unset($fields['body']);?>
<?php unset($fields['field_team_job']);?>
<?php unset($fields['field_team_image']);?>
<?php unset($fields['field_team_socials']);?>
<?php foreach ($fields as $id => $field): ?>
    <?php if (!empty($field->separator)): ?>
        <?php print $field->separator; ?>
    <?php endif; ?>
    <?php print $field->wrapper_prefix; ?>
    <?php print $field->label_html; ?>
    <?php print $field->content; ?>
    <?php print $field->wrapper_suffix; ?>
<?php endforeach; ?>